package com.cskaoyan.controller;

import com.cskaoyan.module.bean.BaseRespVo;
import com.cskaoyan.module.bean.UserData;
import com.cskaoyan.module.bean.param.BaseParam;
import com.cskaoyan.module.bean.vo.CollectData;
import com.cskaoyan.module.bean.vo.FeedbackData;
import com.cskaoyan.module.pojo.MarketAdmin;
import com.cskaoyan.module.pojo.MarketUser;
import com.cskaoyan.service.AdminService;
import com.sun.org.apache.regexp.internal.RE;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.Map;

@RestController
public class AdminController {
    @Autowired
    AdminService adminService;
    @PostMapping("admin/profile/password")
    public BaseRespVo profilePassword(@RequestBody Map map) {
        Subject subject = SecurityUtils.getSubject();
        MarketAdmin admin = (MarketAdmin) subject.getPrincipals().getPrimaryPrincipal();
        Integer id = admin.getId();
        map.put("id", id);
        BaseRespVo baseRespVo = adminService.updatePassword(map);
        return baseRespVo;
    }
}
